KCL supports all kinds of declarations described in the Common Lisp Reference Manual. Any valid declaration will affect the KCL environment in some way or another, although information obtained by declarations, other than special declarations, is mainly used by the KCL compiler.
As described in the Common Lisp Reference Manual, Common Lisp declarations are divided into two classes: proclamations and others. A proclamation is a global declaration given by the function proclaim, the top-level macro defvar, or the top-level macro defparameter. Once given, a proclamation remains effective during the KCL session unless it is shadowed by a local declaration or is canceled by another proclamation. Any other declaration is a local declaration and is given only by the special form declare. A local declaration remains in effect only within the body of the construct that surrounds the declaration. In the following nonsensical example borrowed from Chapter 9 of the Common Lisp Reference Manual,
(defun nonsense (k x z) (foo z x) (let ((j (foo k x)) (x (* k k))) (declare (inline foo) (special x z)) (foo x j z)))
the inline and the special declarations both remain in effect within the surrounding let form. In this case, we say that the let form is the surrounding construct of these declarations.
proclamation decl-spec[Function]
>(proclaim '(special *x*)) ;;; The variable *x* is nil ;;; proclaimed to be globally special. >(proclamation '(special *x*)) t >(defvar *y*) ;;; Another way to proclaim a variable nil ;;; to be globally special. >(proclamation '(special *y*)) t
the value-type form[Special Form]
(the fixnum (foo)) is equivalent to (let ((values (multiple-value-list (foo)))) (cond ((endp values) (error ``Too few return values.'')) ((not (endp (cdr values))) (error ``Too many return values.'')) ((typep (car values) 'fixnum) (car values)) (t (error ``~s is not of type fixnum.'' (car values)))))